package com.sky.mapper.admin;


import com.github.pagehelper.Page;
import com.sky.dto.EmployeePageQueryDTO;
import com.sky.pojo.Employee;
import org.apache.ibatis.annotations.*;


@Mapper
public interface EmployeeMapper {

    /**
     * 根据用户名查询员工
     *
     * @param username
     * @return
     */
    @Select("select * from employee where username = #{username}")
    Employee getByUsername(String username);


    /**
     * 添加员工
     *
     * @param employee
     */
    void save(Employee employee);

    /**
     * 员工分页
     *
     * @param employeePageQueryDTO
     * @return
     */
    Page<Employee> getPage(EmployeePageQueryDTO employeePageQueryDTO);

    /**
     * @param status
     */
    void startOrStop(Integer status, Long id);

    /**
     * 根据员工id回显
     *
     * @param id
     * @return
     */
    @Select("select * from employee where id=#{id}")
    Employee findById(Long id);

    /**
     * 修改员工
     *
     * @param employee
     */
    void update(Employee employee);
}
